package com.lgx.mobile.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.lgx.common.exception.DataException;
import com.lgx.common.web.Pagination;
import com.lgx.mobile.dao.IGroupChatRecordDao;
import com.lgx.mobile.entity.GroupChatRecord;
import com.lgx.mobile.service.IGroupChatRecordService;

/**
 * 圈子聊天记录Service
 * 
 * @author xuyichen
 *
 */
@Service("groupChatRecordService")
public class GroupChatRecordService implements IGroupChatRecordService {

	@Autowired
	private IGroupChatRecordDao groupChatRecordDao;

	public IGroupChatRecordDao getGroupChatRecordDao() {
		return groupChatRecordDao;
	}

	public void setGroupChatRecordDao(IGroupChatRecordDao groupChatRecordDao) {
		this.groupChatRecordDao = groupChatRecordDao;
	}

	@Transactional
	public GroupChatRecord createGroupChatRecord(GroupChatRecord groupChatRecord) throws DataException {
		return this.groupChatRecordDao.createGroupChatRecord(groupChatRecord);
	}

	@Transactional
	public GroupChatRecord updateGroupChatRecord(GroupChatRecord groupChatRecord) throws DataException {
		return this.groupChatRecordDao.updateGroupChatRecord(groupChatRecord);
	}

	@Transactional
	public void deleteGroupChatRecord(GroupChatRecord groupChatRecord) throws DataException {
		this.groupChatRecordDao.deleteGroupChatRecord(groupChatRecord);
	}

	@Transactional
	public void deleteGroupChatRecordById(long id) throws DataException {
		this.groupChatRecordDao.deleteGroupChatRecordById(id);
	}

	public GroupChatRecord findGroupChatRecordById(long id) {
		return this.groupChatRecordDao.findGroupChatRecordById(id);
	}
	
	public List<GroupChatRecord> findGroupChatRecordListByGroupId(long groupId){
		return this.groupChatRecordDao.findGroupChatRecordListByGroupId(groupId);
	}
	
	public List<GroupChatRecord> findGroupChatRecordList() {
		return this.groupChatRecordDao.findGroupChatRecordList();
	}

	@Override
	public Pagination findGroupChatRecordPaginationByGroupId(long groupId, Object[] params, int pageSize, int pageNum) {
		return this.groupChatRecordDao.findGroupChatRecordPaginationByGroupId(groupId,params,pageSize,pageNum);
	}
}
